package cn.gdut.chengcai.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.gdut.chengcai.base.UploadDownloadUtil;

@Controller
public class IoController {

	// public static LogUtil log =
	// LogUtil.getInstance(IoController.class.getName());

	/**
	 * 文件下载操作
	 */
	@RequestMapping("/member/io/downloadAction")
	public void downloadAction(String filename, HttpServletRequest request, HttpServletResponse response) {
		UploadDownloadUtil.downloadAction(filename, request, response);
	}

	/**
	 * 上传文件预览操作
	 */
	@RequestMapping("/member/io/uploadPreviewAction")
	public void uploadPreviewAction(String filename, HttpServletRequest request, HttpServletResponse response) {
		UploadDownloadUtil.uploadPreviewAction(filename, request, response);
	}

	/**
	 * 上传文件预览操作-未登录
	 */
	@RequestMapping("/io/uploadPreviewAction")
	public void uploadPreviewActionNotLogin(String filename, HttpServletRequest request, HttpServletResponse response) {
		UploadDownloadUtil.uploadPreviewAction(filename, request, response);
	}
}
